package com.syh.jn.scm.domain.supplier.entity.finance.archive;

import com.syh.core.ddd.domain.AbstractSimpleAggregate;
import com.syh.jn.scm.dto.supplier.statistics.finance.SettlementsReportVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * Created by soci.song on 2019/3/1.
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class ArchiveSettlements extends AbstractSimpleAggregate<Long> {

    public ArchiveSettlements(SettlementsReportVo vo) {
        this.customerType = vo.getCustomerType();
        this.customerId = vo.getCustomerId();
        this.beginningShouldSettlements = vo.getBeginningShouldSettlements();
        this.beginningAlreadySettlements = vo.getBeginningAlreadySettlements();
        this.totalShouldSettlements = vo.getTotalShouldSettlements();
        this.totalAlreadySettlements = vo.getTotalAlreadySettlements();
        this.recordShouldSettlements = vo.getRecordShouldSettlements();
        this.recordAlreadySettlements = vo.getRecordAlreadySettlements();
        this.purchaseAmount = vo.getPurchaseAmount();
        this.purchaseDiscountAmount = vo.getPurchaseDiscountAmount();
        this.purchaseOtherAmount = vo.getPurchaseOtherAmount();
        this.purchaseReturnAmount = vo.getPurchaseReturnAmount();
        this.purchaseReturnLogisticsAmount = vo.getPurchaseReturnLogisticsAmount();
        this.purchaseReturnDiscountAmount = vo.getPurchaseReturnDiscountAmount();
        this.saleAmount = vo.getSaleAmount();
        this.saleLogisticsAmount = vo.getSaleLogisticsAmount();
        this.saleDiscountAmount = vo.getSaleDiscountAmount();
        this.saleOtherAmount = vo.getSaleOtherAmount();
        this.saleReturnAmount = vo.getSaleReturnAmount();
        this.saleReturnDiscountAmount = vo.getSaleReturnDiscountAmount();
        this.costAmount = vo.getCostAmount();
        this.incomeAmount = vo.getIncomeAmount();
        this.receiptAmount = vo.getReceiptAmount();
        this.paymentAmount = vo.getPaymentAmount();
    }

    /**
     * 主表ID
     */
    private Long archiveId;
    /**
     * 客户id
     */
    private Long customerId;
    /**
     * 客户类型: 0上游, 1下游, 2物流
     */
    private Short customerType;
    /**
     * 期初应收付金额
     */
    private BigDecimal beginningShouldSettlements;
    /**
     * 期初已收付金额
     */
    private BigDecimal beginningAlreadySettlements;
    /**
     * 总应收付金额
     */
    private BigDecimal totalShouldSettlements;
    /**
     * 总已收付金额
     */
    private BigDecimal totalAlreadySettlements;
    /**
     * 结存区间应收付金额
     */
    private BigDecimal recordShouldSettlements;
    /**
     * 结存区间已收付金额
     */
    private BigDecimal recordAlreadySettlements;
    /**
     * 采购订单金额
     */
    private BigDecimal purchaseAmount;
    /**
     * 采购订单优惠金额
     */
    private BigDecimal purchaseDiscountAmount;
    /**
     * 采购订单其他费用
     */
    private BigDecimal purchaseOtherAmount;
    /**
     * 采购退货订单金额
     */
    private BigDecimal purchaseReturnAmount;
    /**
     * 采购退货订单物流金额
     */
    private BigDecimal purchaseReturnLogisticsAmount;
    /**
     * 采购退货订单优惠金额
     */
    private BigDecimal purchaseReturnDiscountAmount;
    /**
     * 销售订单金额
     */
    private BigDecimal saleAmount;
    /**
     * 销售订单物流金额
     */
    private BigDecimal saleLogisticsAmount;
    /**
     * 销售订单优惠金额
     */
    private BigDecimal saleDiscountAmount;
    /**
     * 销售订单其他费用
     */
    private BigDecimal saleOtherAmount;
    /**
     * 销售退货订单金额
     */
    private BigDecimal saleReturnAmount;
    /**
     * 销售退货订单优惠金额
     */
    private BigDecimal saleReturnDiscountAmount;
    /**
     * 费用单金额
     */
    private BigDecimal costAmount;
    /**
     * 收入单金额
     */
    private BigDecimal incomeAmount;
    /**
     * 收款单金额
     */
    private BigDecimal receiptAmount;
    /**
     * 付款单金额
     */
    private BigDecimal paymentAmount;
}
